package deltadesk.gui.deltagui.demo;

import java.net.MalformedURLException;
import java.net.URL;

import deltadesk.gui.deltagui.widget.AnalogClock;
import deltadesk.gui.deltagui.widget.AutoFitPanel;
import deltadesk.gui.deltagui.widget.Box;
import deltadesk.gui.deltagui.widget.BoxPanel;
import deltadesk.gui.deltagui.widget.Panel;
import deltadesk.gui.deltagui.widget.Picture;
import deltadesk.gui.deltagui.widget.Text;

public class BoxDemo extends Panel {

	private static final String TXT = 
		"Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy eirmod tempor " +
		"invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et " +
		"accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata " +
		"sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing " +
		"elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, " +
		"sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita " +
		"kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor " +
		"sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore " +
		"et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo " +
		"dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";

	
	public BoxDemo() throws MalformedURLException {
		super(2);
		setName("content");
		
		Box box = new Box(TXT);
		box.setName("textbox");
		add(box);
		
		box = new Box(getClass().getResource("image1.jpg"));
		box.setName("picbox");
		add(box);

		box = new Box(getClass().getResource("image2.jpg"));
		box.setName("picbox");
		add(box);

		final BoxPanel p = new BoxPanel(2, 2);
		p.setInsets(0, 0, 0, 0, 10);

		final Panel pp = new Panel(2);
		pp.setInsets(0);
		pp.add(new AnalogClock());
		pp.add(new Box(getClass().getResource("image1.jpg")));
		pp.add(new Box(getClass().getResource("image2.jpg")));
		pp.add(new Text(TXT));
		p.add(pp);
		p.add(new AutoFitPanel(new Picture(new URL("http://www.google.de/intl/de_de/images/logo.gif"))));
		p.add(new Text(TXT));
		p.add(new AnalogClock());
		
		add(p);
	}

}
